<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.baoku.wap.dao.*"  %>
<%@ page import="com.baoku.wap.entity.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	String id = request.getParameter("id");
	if (id == null || id == ""){
		response.sendRedirect("login_err.html");
		return;
	}
	
	String password = request.getParameter("password");
	if (id == null || id == ""){
		response.sendRedirect("login_err.html");
		return;
	}
	
	if (new UserFactory().login(id,password)){
		session.setAttribute("login","true");
		session.setAttribute("id",id);
		response.sendRedirect("index.jsp");
	}else{
		response.sendRedirect("login_err.html");
	}
%>
